package zhh.tangbao.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import zhh.tangbao.user.entity.Role;
import zhh.tangbao.user.vo.RoleTypeVo;

import java.util.List;

/**
 * @author 粥灰灰
 * @created 2022/8/20
 * @version 1.0
 * @Description 关于角色的dao层操作
 */

@Repository
@Mapper
public interface RoleDao extends BaseMapper<Role> {

    /**
     * 获取不同类型的账号的默认角色ID
     * @return roleId
     */
    String getDefaultRoleId(String roleType);

    int updateDefaultRoleId(@Param("roleType") String roleType, @Param("newRoleId") Long newRoleId);

    List<RoleTypeVo> getRoleType();
}
